import java.util.HashMap;

/**
 * 
 */

/**
 * @author Paola
 * Structure to store  for each language (from ISO code language) the number of concepts found in the resource with 
 * the tag language
 *
 */
public class ConceptsForLanguage {
	
	 private HashMap<String,Integer> Valuelang;
	  /* This list MUST be in sorted order, and MUST contain the two-letter codes
	    if one exists otherwise use the three letter code */
	 
	 
	 
	 public ConceptsForLanguage()
	  {
		  Valuelang = new HashMap<String,Integer>();
		  
	  for (String l : LanguageTags.getAllISOLangTag()) {

		  Valuelang.put(l,0);
	  }
	  }
	
	  
	  public Integer getNumberConceptsforLanguage(String hashkey)
	  {
	  	return Valuelang.get(hashkey);
	  	
	  }
	  
	  public void setNumberConceptsforLanguage(String hashkey, Integer d)
	  {
	  	 Valuelang.put(hashkey, d);
	  	
	  }
	  
	  
	  public String[] keyToStringArray()
	  {
		  String [] aux=new String[Valuelang.size()];
		  int i=0;
		  //iterating over keys only
		  for (String key : Valuelang.keySet()) {
			  aux[i]=key;
			  i++;
		  }
		  
		  return aux;
	  }


	  
	  public String[] valueToStringArray()
	  {
		  String[] aux=new String[Valuelang.size()];
		  int i=0;
		  //iterating over values only
		  for (Integer key : Valuelang.values()) {
			  aux[i]=key.toString();
			  i++;
		  }
		  
		  return aux;
	  }


	public HashMap<String, Integer> getValuelang() {
		return Valuelang;
	}


	public void setValuelang(HashMap<String, Integer> valuelang) {
		Valuelang = valuelang;
	}

	  





}
